package com.hz.validation;

import com.hz.annotation.State;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class StateValidation implements ConstraintValidator<State, String> {

    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {

        if (s==null){
            return false;
        }
        return s.equals("草稿") || s.equals("已发布");
    }
}
